import { onScopeDispose } from 'vue'
import bus from '@/libs/bus'

const setSettingTypeEventName = 'set-edit-setting-pane-type'

// 发送修改设置面板类型事件
export const emitSetSettingTypeEvent = data => {
    bus.emit(setSettingTypeEventName, data)
}

// 接收修改设置面板类型事件
export const onSetSettingTypeEvent = callback => {
    bus.on(setSettingTypeEventName, callback)
    
    onScopeDispose(() => {
        bus.off(setSettingTypeEventName, callback)
    })
}
